import request from '@/util/request'

export const loginUser = (data: any) => {
  return request({
    url: '/login',
    method: 'POST',
    data: data
  })
}
export const registerUser = (data: any) => {
  return request({
    url: '/register',
    method: 'POST',
    data: data
  })
}

export const logoutUser = () => {
  return request({
    url: '/logout',
    method: 'GET'
  })
}

export const sendEmail = (data: any) => {
  return request({
    url: '/sendEmail',
    method: 'GET',
    params: {
      email: data
    }
  })
}

//获取角色信息
export const getRoleInfo = (roleId: number) => {
  return request({
    url: '/getRoleInfo',
    method: 'GET',
    params: {
      id: roleId
    }
  })
}
